package tech.xs.sys.domain.bo.dict;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import tech.xs.common.domain.enums.YesNoEnum;
import tech.xs.sys.domain.entity.SysDict;
import tech.xs.sys.domain.entity.SysDictData;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @author 沈家文
 * @since 2023/5/30 19:50
 */
@Getter
@Setter
@ToString
public class ManualEditDictDataBo implements Serializable {

    protected Long id;

    @NotBlank
    @Length(min = 1, max = 128)
    private String dictCode;

    @NotBlank
    @Length(min = 1, max = 128)
    private String code;

    @NotBlank
    @Length(min = 1, max = 128)
    private String name;

    private Integer orderValue;

    private YesNoEnum status;

    @Length(max = 1024)
    private String remark;

    public void checkParameter() {
        SysDictData.checkCode(code, "code");
    }

}
